//
//  UIView+TZExtension.h
//  TZOCExtension
//
//  Created by Tim.Z on 2017/1/3.
//  Copyright © 2017年 Tim.Z. All rights reserved.
//

#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
    KTZViewType_cornerRadius2,
    KTZViewType_cornerRadius4,
    KTZViewType_coupon,
} KTZViewType;

@interface UIView (TZExtension)

@property (assign, nonatomic) CGFloat tz_x;
@property (assign, nonatomic) CGFloat tz_y;
@property (assign, nonatomic) CGFloat tz_width;
@property (assign, nonatomic) CGFloat tz_height;
@property (assign, nonatomic) CGSize tz_size;
@property (assign, nonatomic) CGPoint tz_origin;

@property (nonatomic) CGFloat tz_left;        ///< Shortcut for frame.origin.x.
@property (nonatomic) CGFloat tz_top;         ///< Shortcut for frame.origin.y
@property (nonatomic) CGFloat tz_right;       ///< Shortcut for frame.origin.x + frame.size.width
@property (nonatomic) CGFloat tz_bottom;      ///< Shortcut for frame.origin.y + frame.size.height
@property (nonatomic) CGFloat tz_centerX;     ///< Shortcut for center.x
@property (nonatomic) CGFloat tz_centerY;     ///< Shortcut for center.y

@property (nonatomic, weak) UIViewController *tz_VC;

/**
 Returns the visible alpha on screen, taking into account superview and window.
 */
@property (nonatomic, readonly) CGFloat tz_visibleAlpha;

- (void)tz_setupViewWithKTZViewType:(KTZViewType)type;

/**
 Remove all subviews.
 
 @warning Never call this method inside your view's drawRect: method.
 */
- (void)tz_removeAllSubviews;

@end
NS_ASSUME_NONNULL_END
